package se.rkrantz.simpleraid.hibernate.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name = "SIGNUP")
public class Signup {
	public enum Role {Tank, Healer, Dps};
	public enum Status {Available, Unavailable, Confirmed, Passed}
	
	private long signupId;
	private String comment;
	private Role role;
	private Status status;
	
	private WowCharacter signedBy;

	@Id
	@GeneratedValue
	@Column(name = "SIGNUP_ID")
	public long getSignupId() {
		return signupId;
	}
	
	public void setSignupId(long signupId) {
		this.signupId = signupId;
	}
	
	@Column(name = "COMMENT", nullable = false)
	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Column(name = "ROLE", nullable = false)
	@Enumerated(EnumType.STRING)
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "STATUS")
	@Enumerated(EnumType.STRING)
	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	@ManyToOne(cascade = CascadeType.ALL)
	public WowCharacter getSignedBy() {
		return signedBy;
	}
	
	public void setSignedBy(WowCharacter signedBy) {
		this.signedBy = signedBy;
	}
}
